package com.bidevalution.controller.api;

import com.bidevalution.business.service.BeSectionTechService;
import com.bidevalution.dao.entity.BeSectionInfo;
import com.bidevalution.dao.entity.TdTechnology;
import com.bidevalution.dao.mapper.BeSectionInfoMapper;
import com.bidevalution.dao.mapper.TdTechnologyMapper;
import com.qtp.core.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author huyiqi
 * @date 2020/3/18
 */
@RestController
@RequestMapping("/beSectionTech")
@Api(tags = "技术标相关接口")
public class BeSectionTechController {

    private static final Logger log = LoggerFactory.getLogger(BeSectionTechController.class);

    @GetMapping("/getScoreItem")
    @ApiOperation(value = "获取技术标评审项", response = String.class)
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(paramType = "query", dataType = "String", name = "sectionId", value = "标段主键", required = true)
            })
    public Response<List<TdTechnology>> getScoreItem(@RequestParam("sectionId") String sectionId) {
        return sectionTechService.getTechnologyBySectionId(sectionId);
    }

    @GetMapping("/getEntTechScores")
    @ApiOperation(value = "获取技术标评审项", response = String.class)
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(paramType = "query", dataType = "String", name = "sectionId", value = "标段主键", required = true),
                    @ApiImplicitParam(paramType = "query", dataType = "String", name = "expertId", value = "专家id", required = true)
            })
    public Response<List<Map<String, String>>> getEntTechScores(@RequestParam("sectionId") String sectionId,@RequestParam("expertId") String expertId) {
        return sectionTechService.getEntTechScores(sectionId, expertId);
    }



    @Autowired
    private BeSectionTechService sectionTechService;
}
